import 'package:flutter/material.dart';

import '../../../bean/userinfo_bean.dart';
import '../../../common/system_config.dart';
import '../../../utils/tools/screenutil_tool.dart';

class RowTextWidget extends StatelessWidget {
  Widget _widget;

  RowTextWidget(UserInfoBean data) {
    _widget = createText(data);
  }

  @override
  Widget build(BuildContext context) => _widget;

  /// ### 创建Text
  /// #### [data] UserInfoBean|必填|用户信息
  Widget createText(UserInfoBean data) {
    Widget w;
    TextStyle textStyle = TextStyle(fontSize: SystemConfig.fs_content3);
    if (data != null) {
      w = Text("${UserInfoBean.name} · ${UserInfoBean.account}",
          style: textStyle);
    } else {
      w = Text("匿名 · 未知", style: textStyle);
    }
    return w;
  }
}
